<template>
  <div>
    <el-card>
      <el-table
        style="width=100%"
        border
        :data="permissionList"
        :tree-props="{
          children: 'children',
          hasChildren: 'hasChildren'
        }"
        default-expand-all
        row-key="id"
      >
        <el-table-column
          prop="permissionName"
          :label="$t('msg.permission.name')"
          width="200"
        ></el-table-column>
        <el-table-column
          prop="permissionMark"
          :label="$t('msg.permission.mark')"
          width="200"
        >
        </el-table-column>
        <el-table-column
          prop="permissionDesc"
          :label="$t('msg.permission.desc')"
        >
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script setup>
import { getPermissionList } from '@/api/permission'
import { onMounted, ref } from 'vue'
import { watchSwitchLang } from '@/utils/i18n'
const permissionList = ref([])
const reqPermission = async () => {
  permissionList.value = await getPermissionList()
  console.log('🚀 ~ reqPermission ', permissionList.value)
}
onMounted(reqPermission)
watchSwitchLang(reqPermission)
</script>

<style lang="scss" scoped></style>
